<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>选择区域</title>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/jquery.i18n.properties.min.js"></script>
    <script src="/js/util.js"></script>
    <link rel="stylesheet" href="/js/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/common.css" media="all">
    <script src="/js/layui/layui.all.js"></script>
</head>
<body class="th">
<div style="width: 100%;height: 100%;text-align: center">
    <span data-lang="chooseArea" style="font-size: 14px;color: red" id="titl">Select an area to get the corresponding customer service</span>
    <div class="layui-form" style="text-align: center;margin: auto;" id="areadiv">

    </div>
</div>
</body>
<script>
    var $ = layui.$;
    var form = layui.form;

    $(function () {
        $("#titl").html("选择区域获得相应的客服");
        $.ajax({
            url:'/area/getAllArea?yuyan=zh',
            type:'get',
            success:function (res) {
                if(res.code==200){
                    var list = res.data;
                    for (let i = 0; i < list.length; i++) {
                        let a = '<input type="radio" name="area" value="'+list[i].id+'" title="'+list[i].areaName+'">';
                        $("#areadiv").append(a);
                    }
                }
                form.render();
            }
        });

    });

    function getAreaId(){
        var areaId = $("input[name='area']:checked").val();
        return areaId;
    }
</script>
</html>